﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ZX.EHR.Library
{
    public class JsonScheduleViewData
    {
        public static List<object[]> ConvertToStringArray(ICollection<wkCalendar> list)
        {
            List<object[]> relist = new List<object[]>();

            if (list != null && list.Count > 0)
            {
                foreach (wkCalendar entity in list)
                {
                    relist.Add(new object[] { 
                       entity.ID, 
                       entity.Holiday, 
                       entity.SolutionID, 
                       entity.DayType, 
                       entity.AddUser, 
                       entity.AddTime,
                       entity.RecID });
                }
            }
            return relist;
        }

        public JsonScheduleViewData(List<object[]> eventList, DateTime startDate, DateTime endDate)
        {
            events = eventList;
            start = startDate;
            end = endDate;
        }


        public JsonScheduleViewData(string jsonError)
        {
            error = jsonError;
        }
        public List<object[]> events { get; private set; }

        public DateTime start { get; private set; }
        public DateTime end { get; private set; }
        public string error { get; private set; }
    }
}
